﻿using Fozzy;
using Fozzy.Skin;
using System.Collections.Generic;
using System.Windows;

namespace Microsoft.FamilyShow
{
    /// <summary>
    /// Concept built to manage the FamilyShow Resources conveyed by the ResourceManager
    /// </summary>
    internal class Resources                                                        : Fozzy.WPF._Resources
    {
        #region Declarations
        #endregion

        #region Structure
            private System.Type             Type_Image                              { get { return typeof(System.Drawing.Bitmap)            ; } }
            private System.Type             Type_Story                              { get { return typeof(string)                           ; } }
        #endregion

        #region Resources
            public Resource                 Extension                               { get { return Instance("DefaultFamilyExtension")       ; } }
            public Resource                 Skins                                   { get { return Instance("Skins")                        ; } }
            public Resource                 Xaml_Extension                          { get { return Instance("XamlExtension")                ; } }
            public Resource                 Names                                   { get { return Instance("ResourcesString")              ; } }
        #endregion

        #region Properties
            public Resources(ResourceDictionary dictionary)                         : base(dictionary)                                                       
            {}
        #endregion

            protected override void Prepare()
            {
                base.Prepare()                                                      ;
                Prepare_Bytes()                                                     ;
                Prepare_Images()                                                    ;
                Prepare_Stories()                                                   ;
            }

            /// <summary>
            /// Preparing Bytes[]   Resources
            /// Preparing Photos    Resources
            /// Preparing Stories   Resources
            /// </summary>

            private void Prepare_Bytes()
            {
                Prepare("Windsor", Microsoft.FamilyShow.extension.family)           ;
                Prepare("Kennedy", Microsoft.FamilyShow.extension.ged)              ;
            }

            private void Prepare(string name, extension extension)
            {
                Instance(new Extended_Name(name,extension)).Save<Fozzy.Byte[]>(Directory)    ;
            }

            private void Prepare_Images()
            {
                new Photos(Resources(Type_Image))                                  ;
                //CreateSampleFile(imageLocation, "Edward VII.jpg", FamilyShow.Properties.Resources.Image_Edward_VII);
                //CreateSampleFile(imageLocation, "Edward VIII.jpg", FamilyShow.Properties.Resources.Image_Edward_VIII);
                //CreateSampleFile(imageLocation, "Elizabeth II.jpg", FamilyShow.Properties.Resources.Image_Elizabeth_II);
                //CreateSampleFile(imageLocation, "George V.jpg", FamilyShow.Properties.Resources.Image_George_V);
                //CreateSampleFile(imageLocation, "George VI.jpg", FamilyShow.Properties.Resources.Image_George_VI);
                //CreateSampleFile(imageLocation, "Margaret Rose.jpg", FamilyShow.Properties.Resources.Image_Margaret_Rose);
                //CreateSampleFile(imageLocation, "Prince Charles.jpg", FamilyShow.Properties.Resources.Image_Prince_Charles);
                //CreateSampleFile(imageLocation, "Prince Henry.jpg", FamilyShow.Properties.Resources.Image_Prince_Henry);
                //CreateSampleFile(imageLocation, "Prince William.jpg", FamilyShow.Properties.Resources.Image_Prince_William);
                //CreateSampleFile(imageLocation, "Princess Diana.jpg", FamilyShow.Properties.Resources.Image_Princess_Diana);
            }

            private void Prepare_Stories()
            {
                new Stories(Resources(Type_Story))                                 ;
                //string storyLocation = Path.Combine(location, Story.Const.StoriesFolderName);
                //Directory.CreateDirectory(storyLocation);
                //CreateSampleFile(storyLocation, "Camilla Shand {cb2c1f69-5311-403a-948f-eaf74dd8e72d}.rtf", FamilyShow.Properties.Resources.Story_Camilla_Shand);
                //CreateSampleFile(storyLocation, "Edward VII Wettin {I1}.rtf", FamilyShow.Properties.Resources.Story_Edward_VII_Wettin);
                //CreateSampleFile(storyLocation, "Edward VIII Windsor {I5}.rtf", FamilyShow.Properties.Resources.Story_Edward_VIII_Windsor);
                //CreateSampleFile(storyLocation, "Elizabeth II Alexandra Mary Windsor {I9}.rtf", FamilyShow.Properties.Resources.Story_Elizabeth_II_Alexandra_Mary_Windsor);
                //CreateSampleFile(storyLocation, "George V Windsor {I3}.rtf", FamilyShow.Properties.Resources.Story_George_V_Windsor);
                //CreateSampleFile(storyLocation, "George VI Windsor {I7}.rtf", FamilyShow.Properties.Resources.Story_George_VI_Windsor);
                //CreateSampleFile(storyLocation, "Margaret Rose Windsor {I24}.rtf", FamilyShow.Properties.Resources.Story_Margaret_Rose_Windsor);
                //CreateSampleFile(storyLocation, "Charles Philip Arthur Windsor {I11}.rtf", FamilyShow.Properties.Resources.Story_Charles_Philip_Arthur_Windsor);
                //CreateSampleFile(storyLocation, "Diana Frances Spencer {I12}.rtf", FamilyShow.Properties.Resources.Story_Diana_Frances_Spencer);
            }
    }

}
